package com.controller.admin;


import com.dto.ShangJiaDto;
import com.service.ShangJiaService;
import com.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("adminShangJia")
@Api(tags = "管理端商家相关接口")
public class AdminShangJiaController {
    @Autowired
    private ShangJiaService shangJiaService;

    @PostMapping("/add")
    @ApiOperation("新增商户接口")
    public Result<String> addShangJia(@RequestBody ShangJiaDto shangJiaDto){
        Boolean aBoolean = shangJiaService.addShangJia(shangJiaDto);
        if(aBoolean){
            return Result.success("添加商户成功");
        }
        return Result.error("新增商户失败");
    }
}
